Skip to content

Conversation

hhashimoto
Copy link

Because Object.keys(outputs).length < 60 on
lib/util.js#stackHasRoom always returns true.

Because `Object.keys(outputs).length < 60` on
`lib/util.js#stackHasRoom` always returns true.
@dougmoscrop
Copy link
Owner

Can you add a test? I'm surprised why this happens, because all outputs are supposed to be rewritten with their migrated ones:

https://github.com/dougmoscrop/serverless-plugin-split-stacks/blob/master/lib/replace-outputs.js#L6

In fact this way seems like it would lose outputs?

@hhashimoto
Copy link
Author

stack.Outputs are added by lib/util.js#nestedOutput
https://github.com/dougmoscrop/serverless-plugin-split-stacks/blob/master/lib/utils.js#L84

and called lib/util.js#stackHasRoom before lib/util.js#nestedOutput
https://github.com/dougmoscrop/serverless-plugin-split-stacks/blob/master/split-stacks.js#L60

    return Promise.resolve()
      .then(() => this.setDeploymentBucketEndpoint())
      .then(() => this.migrateExistingResources()) // Call lib/util.js#stackHasRoom
      .then(() => this.migrateNewResources()) // Call lib/util.js#stackHasRoom
      .then(() => this.replaceReferences()) // Call lib/util.js#nestedOutput
      .then(() => this.replaceOutputs()) // Call lib/util.js#nestedOutput
      .then(() => this.replaceConditions())
      .then(() => this.mergeStackResources())
      .then(() => this.sequenceStacks())
      .then(() => this.writeNestedStacks())
      .then(() => this.logSummary());

then stack.Outputs is always {} whenever called lib/util.js#stackHasRoom
https://github.com/dougmoscrop/serverless-plugin-split-stacks/blob/master/lib/utils.js#L193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants